package edu.zerl.easyexceldemo.controller;

import edu.zerl.easyexceldemo.service.ExcelWriterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@Slf4j
@RestController
public class ExcelWriterController {

    @Autowired
    ExcelWriterService excelWriterService;

    @PostMapping("/v1/download")
    public void doDownLoad() throws IOException {
        excelWriterService.doDownLoad();
    }

    @PostMapping("/v1/webDownload")
    public void webDownLoad() throws IOException {
        excelWriterService.webDownLoad();
    }
}
